﻿using System;
using System.Collections.Generic;
using System.Text;

using efish.Framework.Common;

namespace efish.Framework.Model
{
    public class Member : BaseModel
    {
        #region Basic info
        private string _email;
        public virtual string Email
        {
            get
            {
                return _email;
            }
            set
            {
                _email = value;
            }
        }

        private string _password;
        public virtual string Password
        {
            get
            {
                return _password;
            }
            set
            {
                _password = value;
            }
        }

        #endregion

        #region Billing Information

        private string _firstName;
        public virtual string FirstName
        {
            get
            {
                return _firstName;
            }
            set
            {
                _firstName = value;
            }
        }

        private string _mi;
        public virtual string MI
        {
            get
            {
                return _mi;
            }
            set
            {
                _mi = value;
            }
        }

        private string _lastName;
        public virtual string LastName
        {
            get
            {
                return _lastName;
            }
            set
            {
                _lastName = value;
            }
        }

        private string _companyName;
        public virtual string CompanyName
        {
            get
            {
                return _companyName;
            }
            set
            {
                _companyName = value;
            }
        }

        private string _address;
        public virtual string Address
        {
            get
            {
                return _address;
            }
            set
            {
                _address = value;
            }
        }

        private string _address2;
        public virtual string Address2
        {
            get
            {
                return _address2;
            }
            set
            {
                _address2 = value;
            }
        }

        private string _city;
        public virtual string City
        {
            get
            {
                return _city;
            }
            set
            {
                _city = value;
            }
        }

        private string _state;
        public virtual string State
        {
            get
            {
                return _state;
            }
            set
            {
                _state = value;
            }
        }

        private string _zipCode;
        public virtual string ZipCode
        {
            get
            {
                return _zipCode;
            }
            set
            {
                _zipCode = value;
            }
        }

        private string _eveningPhone;
        public virtual string EveningPhone
        {
            get
            {
                return _eveningPhone;
            }
            set
            {
                _eveningPhone = value;
            }
        }

        private string _dayPhone;
        public virtual string DayPhone
        {
            get
            {
                return _dayPhone;
            }
            set
            {
                _dayPhone = value;
            }
        } 

        #endregion

        #region Optional Information
        private bool _isBusinessUse;
        public virtual bool IsBusinessUse
        {
            get
            {
                return _isBusinessUse;
            }
            set
            {
                _isBusinessUse = value;
            }
        }

        private int _age;
        public virtual int Age
        {
            get
            {
                return _age;
            }
            set
            {
                _age = value;
            }
        }

        private int _incomeCode;
        public virtual int IncomeCode
        {
            get
            {
                return _incomeCode;
            }
            set
            {
                _incomeCode = value;
            }
        }

        private int _educationCode;
        public virtual int EducationCode
        {
            get
            {
                return _educationCode;
            }
            set
            {
                _educationCode = value;
            }
        }

        private int _knowCode;
        public virtual int KnowCode
        {
            get
            {
                return _knowCode;
            }
            set
            {
                _knowCode = value;
            }
        }

        #endregion

        #region Subscriptions
        private bool _isSubscriber;
        public virtual bool IsSubscriber
        {
            get
            {
                return _isSubscriber;
            }
            set
            {
                _isSubscriber = value;
            }
        }

        #endregion

        private string _name;
        public virtual string Name
        {
            get
            {
                if (_name.Trim() == string.Empty)
                {
                    string strNameF = "{0} {1} {2}";
                    _name = string.Format(strNameF, new object[] { FirstName, MI, LastName });

                    if (_name.Trim() == string.Empty)
                    {
                        _name = EmailAddressTool.GetAccount(this.Email);
                    }
                }
                return _name;
            }
            set
            {
                _name = value;
            }
        }
    }
}
